import React, { Component } from 'react';
import { connect } from 'react-redux'
class App extends Component {
    state = {
        list: [
            {
                name: "aaa",
                title: "aa1",
                code: 0
            }, {
                name: "bbb",
                title: "aa1",
                code: 1
            }, {
                name: "ccc",
                title: "bb1",
                code: 1
            }, {
                name: "ddd",
                title: "bb1",
                code: 0
            }, {
                name: "eee",
                title: "bb1",
                code: 0
            },
        ]
    }
    render() {
        return (
            
                // <Provider store={store}>
                    <div className="app">
                       aaas
                    </div>
                // </Provider>
        
        )
    }
}

// export default App
let applist = state => {
    return {
        list: state.list,  //获取redux的list数据
    }
}
let fock = dispatch => {
    return {
        getData(list) {
            dispatch({ type: "GET_DATA", list }) //传list用GET_DATA方法
        }
    }
}
export default connect(applist, fock)(App)
